<style type="text/css">
	* {
		margin:0;
		padding:0;
	}
	.error_tip{
		height:auto;
		margin-left:20px;
		margin-top:10px;
		width:80%;
	}
</style>

<div class="error_tip"><?php echo $this->getMessagesBlock()->getGroupedHtml() ?></div>
<?php if($this->getTitle()): ?>
<div id="YellowTitle">
    <?php echo $this->getTitle() ?>
</div>
<?php endif; ?>
<div id="Title_Content"><?php echo $this->__('Contact Information') ?><br/></div>

<div style="margin-left:20px">
<form action="<?php echo $this->getSaveUrl() ?>" method="post" id="form-validate">
    
    <div>
    <?php echo $this->getBlockHtml('formkey')?>
    <input type="hidden" name="success_url" value="<?php echo $this->getSuccessUrl() ?>" />
    <input type="hidden" name="error_url" value="<?php echo $this->getErrorUrl() ?>" />
    <input type="hidden" name="country_id" id="country" value="CN" />
        <ul class="form-list group-select">
            <li>
                <?php echo $this->getLayout()->createBlock('customer/widget_name')->setObject($this->getAddress()->getFirstname() ? $this->getAddress() : $this->getCustomer())->toHtml() ?>
            </li>
            <li>
                <div class="input-box">
                    <label for="telephone"><?php echo $this->__('Telephone') ?> <span class="required">*</span></label><br />
                    <input type="text" name="telephone" value="<?php echo $this->htmlEscape($this->getAddress()->getTelephone()) ?>" title="<?php echo $this->__('Telephone') ?>" class="input-text required-entry" id="telephone" />
                </div>
            </li>
        </ul>
    </div>
    
    <div>
        <h4 class="bold dark-gray"><?php echo $this->__('Address') ?></h4>
        <ul class="form-list group-select">
            <li>
                <div class="input-box">
                    <label for="region_id"><?php echo $this->__('State/Province') ?> <span class="required">*</span></label><br />
                    <select id="region_id" name="region_id" title="<?php echo $this->__('State/Province') ?>" class="validate-select" style="display:none">
                       <option value=""><?php echo $this->__('-- Please select --') ?></option>
                    </select>
                    <script type="text/javascript">
                        $('region_id').setAttribute('defaultValue',  "<?php echo $this->htmlEscape($this->getAddress()->getRegionId()) ?>");
                    </script>
                    <input type="text" id="region" name="region" value="<?php echo $this->htmlEscape($this->getAddress()->getRegion()) ?>" title="<?php echo $this->__('State/Province') ?>" class="input-text" style="display:none" />
                </div>
                <div class="input-box">
                    <label for="city"><?php echo $this->__('City') ?> <span class="required1">*</span></label><br />
                    <input type="text" name="city" value="<?php echo $this->htmlEscape($this->getAddress()->getCity()) ?>"  title="<?php echo $this->__('City') ?>" class="input-text required-entry" id="city" />
                </div>
            </li>
            <li>
                <label for="street_1"><?php echo $this->__('Street Address') ?> <span class="required">*</span></label><br />
                <input type="text" name="street[]" value="<?php echo $this->htmlEscape($this->getAddress()->getStreet(1)) ?>" title="<?php echo $this->__('Street Address') ?>" id="street_1" class="input-text required-entry" />
            </li>
        <?php for ($_i=2, $_n=$this->helper('customer/address')->getStreetLines(); $_i<=$_n; $_i++): ?>
            <li>
                <input type="text" name="street[]" value="<?php echo $this->htmlEscape($this->getAddress()->getStreet($_i)) ?>" title="<?php echo $this->__('Street Address '.$_i) ?>" id="street_<?php echo $_i?>" class="input-text" />
            </li>
        <?php endfor ?>
            <li>
                <div class="input-box">
                    <label for="zip"><?php echo $this->__('Zip/Postal Code') ?> <span class="required">*</span></label><br />
                    <input type="text" name="postcode" value="<?php echo $this->htmlEscape($this->getAddress()->getPostcode()) ?>" title="<?php echo $this->__('Zip/Postal Code') ?>" id="zip" class="input-text validate-zip-international required-entry" />
                </div>
            </li>
            <li>
                <?php if($this->isDefaultBilling()): ?>
                    <strong><?php echo $this->__('Default Billing Address') ?></strong>
                <?php elseif($this->canSetAsDefaultBilling()): ?>
                    <input type="checkbox" id="primary_billing" name="default_billing" value="1" class="checkbox" />
                    <label for="primary_billing"><?php echo $this->__('Use as my default billing address') ?></label>
                <?php else: ?>
                    <input type="hidden" name="default_billing" value="1" />
                <?php endif; ?>
            </li>
            <li>
                <?php if($this->isDefaultShipping()): ?>
                    <strong><?php echo $this->__('Default Shipping Address') ?></strong>
                <?php elseif($this->canSetAsDefaultShipping()): ?>
                    <input type="checkbox" id="primary_shipping" name="default_shipping" value="1" class="checkbox" />
                    <label for="primary_shipping"><?php echo $this->__('Use as my default shipping address') ?></label>
                <?php else: ?>
                    <input type="hidden" name="default_shipping" value="1" />
                <?php endif; ?>
            </li>
        </ul>
    </div>
    
    <div class="buttons-set" style="width: 550px;">
    <input type="image" src="<?php echo $this->getSkinUrl('images/button_submit.jpg');?>" /><span style="padding-right:40px;padding-left:20px;">&nbsp;</span>
</div>
</form>
</div>

<script type="text/javascript">
//<![CDATA[
    var dataForm = new VarienForm('form-validate', true);
    new RegionUpdater('country', 'region', 'region_id', <?php echo $this->helper('directory')->getRegionJson() ?>);
//]]>
</script>
